/* 新增CSS变量 */
:root {
    --primary-color: #2c3e50;       /* 主色调 */
    --secondary-color: #3498db;     /* 次色调 */
    --accent-color: #e74c3c;        /* 强调色 */
    --light-bg: #f8f9fa;           /* 浅色背景 */
    --dark-text: #2c3e50;          /* 深色文字 */
    --light-text: #95a5a6;         /* 浅色文字 */
    --shadow-color: rgba(0,0,0,0.1); /* 阴影颜色 */
}

/* 基础重置 */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部样式 */
header {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow-color);
    margin-bottom: 2rem;
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    text-align: center;
    margin: 0;
    padding: 1rem 0;
    position: relative;
}

h1::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: var(--secondary-color);
    margin: 1rem auto;
}

h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin: 2rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

/* 导航按钮组 */
.nav-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
}

/* 主按钮样式 */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* 搜索表单 */
.search-container {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 2rem auto;
}

#searchKeyword {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

#searchKeyword:focus {
    border-color: var(--secondary-color);
    outline: none;
}

/* 分类标签 */
.category-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.category-buttons button {
    padding: 0.8rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    color: var(--dark-text);
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-buttons button:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px var(--shadow-color);
}

/* 博文卡片 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: transform 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
}

.post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 3px solid var(--light-bg);
}

.post-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-brief {
    color: var(--light-text);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .category-buttons {
        grid-template-columns: repeat(3, 1fr);
    }

    header {
        padding: 1.5rem;
    }
}

/* 弹窗表单优化 */
.vertical-form-popup {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.swal2-input {
    border-radius: 6px !important;
    transition: border-color 0.3s ease !important;
}

.swal2-input:focus {
    border-color: var(--secondary-color) !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1) !important;
}